import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:"/",
    name:"Home",
    component:Home
  },
  {
    path:"/login",
    name:"Login",
    component:()=>import("../views/Login.vue")
  },
  {
    path:"/register",
    name:"Register",
    component:()=>import("../views/Register.vue")
  },
  {
    path:"/NEX",
    name:"NEXseries",
    component:()=>import("../views/NEX_series.vue")
  },
  {
    path:"/X",
    name:"Xseries",
    component:()=>import("../views/X_series.vue")
  },
  {
    path:"/S",
    name:"Sseries",
    component:()=>import("../views/S_series.vue")
  },
  {
    path:"/T",
    name:"Tseries",
    component:()=>import("../views/T_series.vue")
  },
  {
    path:"/Y",
    name:"Yseries",
    component:()=>import("../views/Y_series.vue")
  },
  {
    path:"/IQOO",
    name:"IQOOphone",
    component:()=>import("../views/IQOOphone.vue")
  },
  {
    path:"/",
    name:"Smart",
    component:()=>import("../views/Smart.vue")
  },
  {
    path:"/shopmall",
    name:"Shopmall",
    component:()=>import("../views/Shop_mall.vue")
  },
  {
    path:"/serve",
    name:"Serve",
    component:()=>import("../views/Serve.vue")
  },
  {
    path:"/particulars/:id",
    name:"Particulars",
    component:()=>import("../views/particulars.vue"),
    beforeEnter:(to,from,next)=>{
      window.scroll(0,0);
      next();
    }
  },
  {
    path:"/shopcar",
    name:"ShopCar",
    component:()=>import("../views/shopCar.vue")
  }
]

const router = new VueRouter({
  routes
})

export default router
